package com.wc.AlgoOJ_train.train5_数据结构.c5_堆.DS0503_大富翁游戏;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/4 16:01
 * @description http://43.138.190.70:8888/p/DS0503
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010;
    static int[] a = new int[N];
    static int[][] f = new int[N << 2][2];
    static int n, m;
    static int op, p, x;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        Arrays.fill(a, 1, n + 1, 100);
        build(1, n, 1);
        while (m-- > 0) {
            op = sc.nextInt();
            if (op == 1) {
                p = sc.nextInt();
                x = sc.nextInt();
                a[p] += x;
                update(1, n, 1, p, a[p]);
            } else {
                out.println(f[1][1] + " " + f[1][0]);
            }
        }
        out.flush();
    }

    static void build(int l, int r, int t) {
        if (l == r) {
            f[t][0] = f[t][1] = 100;
            return;
        }
        int mid = l + r >> 1;
        build(l, mid, t << 1);
        build(mid + 1, r, t << 1 | 1);

        f[t][0] = Math.min(f[t << 1][0], f[t << 1 | 1][0]);
        f[t][1] = Math.max(f[t << 1][1], f[t << 1 | 1][1]);
    }

    // 更新,讲p人里面的更新为c
    static void update(int l, int r, int t, int p, int c) {
        if (l == r) {
            f[t][0] = f[t][1] = c;
            return;
        }
        int mid = l + r >> 1;
        if (p <= mid) update(l, mid, t << 1, p, c);
        else update(mid + 1, r, t << 1 | 1, p, c);

        f[t][0] = Math.min(f[t << 1][0], f[t << 1 | 1][0]);
        f[t][1] = Math.max(f[t << 1][1], f[t << 1 | 1][1]);
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}